import Vue from "vue";
import VueRouter from "vue-router";
import layout from "@/layout/index";
// import layout from '@/layout/layout'

Vue.use(VueRouter);

const routes = [
    {
        name: "login",
        path: "/", //登录
        component: () => import("@/views/system/login")
        // component: () => import('@/views/system/login')
    },
    {
        name: "login",
        path: "/login", //登录
        component: () => import("@/views/system/login")
        // component: () => import('@/views/system/login')
    },
    {
        path: "/welcomexczx",
        component: layout,
        redirect: "/welcomexczx",
        children: [
            {
                path: "/welcomexczx",
                name: "welcomexczx",
                component: () => import("@/views/system/welcomexczx")
            },
            {
                path: "/permission",
                name: "sys.permission",
                component: () => import("@/views/system/permission")
            },
            {
                path: "/account",
                name: "sys.account",
                component: () => import("@/views/system/account")
            },
            {
                path: "/menu",
                name: "sys.menu",
                component: () => import("@/views/system/menu")
            },
            {
                path: "/power",
                name: "sys.power",
                component: () => import("@/views/system/power")
            },
            {
                path: "/role",
                name: "sys.role",
                component: () => import("@/views/system/role")
            },
            {
                name: "sys.loginlog",
                path: "/loginlog",
                component: () => import("@/views/system/loginlog")
            },
            {
                name: "sys.errorlog",
                path: "/errorlog",
                component: () => import("@/views/system/errorlog")
            },
            {
                name: "sys.apilog",
                path: "/apilog",
                component: () => import("@/views/system/apilog")
            },
            {
                name: "sys.codecreate",
                path: "/codecreate",
                component: () => import("@/views/system/codecreate")
            },
            {
                name: "sys.empty",
                path: "/empty",
                component: () => import("@/views/system/empty")
            },
            {
                name: "sys.classroom",
                path: "/classroom",
                component: () => import("@/views/school/classroom")
            },
            {
                name: "designer",
                path: "/designer",
                component: () => import("@/views/base/designer")
            },
            {
                name: "base.printTemp",
                path: "/printTemp",
                component: () => import("@/views/base/printTemp")
            },
            {
                name: "base.printTempForHiprint",
                path: "/printTempForHiprint",
                component: () => import("@/views/base/printTempForHiprint")
            },
            {
                name: "hiprintDesigner",
                path: "/hiprintDesigner",
                component: () => import("@/views/base/hiprintDesigner")
            }
        ]
    }
];

const router = new VueRouter({
    mode: "hash",
    base: process.env.BASE_URL,
    routes
});

export default router;
